package com.imooc.framework.quartz;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;

public class TestScheduler {

    public static void main(String[] args) throws SchedulerException {
        // 创建SchedulerFactory实例
        SchedulerFactory schedulerFactory = new StdSchedulerFactory();

        // 获取Scheduler实例
        Scheduler scheduler = schedulerFactory.getScheduler();


        // 参数
        JobDataMap dataMap = new JobDataMap();
        dataMap.put("name", "张三");
        JobKey jobKey = JobKey.jobKey("myJob", "group1");
        if (scheduler.checkExists(jobKey))
        {
            System.out.println("hhhhhh");
            scheduler.triggerJob(jobKey, dataMap);
        }
    }
}
